package com.ice.demo.generic.interfaces;



// 2. 接口实现：专门序列化 User
public class UserSerializer implements Serializer<User> {
    @Override
    public String toJson(User u) {
        return """
           {"id":%s,"name":"%s"}
           """.formatted(u.id(), u.name());
    }
}